package com.liuyu.common.framework.scheduler;

import com.google.common.util.concurrent.ThreadFactoryBuilder;

import java.util.concurrent.*;

/**
 * @ClassName GlobalExecutorUtils
 * @Author: liuyu
 * @Date: Created in 2020/11/13 12:19
 * @Version: 1
 * @Modified By:
 */
public class GlobalExecutorUtils {
    public static final int CORE = Runtime.getRuntime().availableProcessors();
    public static final ThreadFactory THREAD_FACTORY = new ThreadFactoryBuilder().setNameFormat("insure-pool-%d").build();
    public static final ExecutorService EXECUTOR_SERVICE = new ThreadPoolExecutor(CORE * 2, CORE * 4, 30, TimeUnit.SECONDS, new ArrayBlockingQueue<>(10000), THREAD_FACTORY);
}
